package com.yijiu.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.yijiu.resource.Bank;
import com.yijiu.trb.R;

public class BankAdapter extends BaseAdapter {

	private Context context;

	private List<Bank> list;

	public BankAdapter(Context context, List<Bank> list) {
		this.context = context;
		this.list = list;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		convertView = LayoutInflater.from(context).inflate(R.layout.bank_or_city_adapter_layout, null);
		// ImageView bankIcon = (ImageView)
		// convertView.findViewById(R.id.iv_bank_or_city_adapter_bank_icon);
		TextView bankName = (TextView) convertView.findViewById(R.id.tv_bank_or_city_adapter_title);
		Bank bank = list.get(position);
		bankName.setText(bank.bankName);
		// new DownLoadImage(bankIcon).execute(bank.logoUrl);
		return convertView;
	}

}
